package com.xx.plugin.es.enc.token;

import org.apache.lucene.analysis.TokenFilter;
import org.apache.lucene.analysis.TokenStream;

import java.io.IOException;

/**
 * TokenStream介绍：
 * <p>
 * https://www.cnblogs.com/stronger-brother/p/13612210.html
 */
public class EncTokenFilter extends TokenFilter {

    private EncTokenNormalizer normalizer;

    @Override
    public boolean incrementToken() throws IOException {
        System.out.println(">>>>>>>>>>>");
        if (input.incrementToken()) {
            return true;
        }
        return false;
    }

    public EncTokenFilter(TokenStream input, EncTokenNormalizer normalizer) {
        super(input);
        this.normalizer = normalizer;
    }
}
